package com.blb.java10security.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.java10security.entity.Permission;
import com.blb.java10security.entity.Role;
import com.blb.java10security.entity.User;
import com.blb.java10security.mapper.UserMapper;
import com.blb.java10security.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<Role> getRolesByUsername(String username) {
        return userMapper.selectRolesByUsername(username);
    }

    @Override
    public List<Permission> getPermissionByUsername(String username) {
        return userMapper.selectPermissionByUsername(username);
    }
}
